package edu.java.lectures.lec09.exceptions.hierarchy;

import edu.java.lectures.lec09.exceptions.creation.MySubSubException;

public class MySubClass extends MyClass {

    MySubClass() {
    }

    @Override
    // public void doSomething1() throws MyException {// NOT ALLOWED
    // HAVE TO choose the class of the exception declared in the super method or
    // some subclass
    public void doSomething1() throws MySubSubException { // exception-subclass
	throw new MySubSubException(
		"Problem in method MySubClass#doSomething1()");
    }

    // INVALID -- NOT ALLOWED
    // @Override
    // public void doSomething2() throws MySubException {
    // throw new MySubException(
    // "Problem in method MySubClass#doSomething2()");
    // }

    @Override
    public void doSomething2() {
	System.out.println("exception free");
    }
}
